#pragma once

#include <boostext/util/make_shared.hpp>

#include "exports.hpp"
#include "Type.hpp"




namespace Engine
{
	namespace Script
	{
		/**
		 * A Reflectable implementation can be seen as a storage for type data.
		 * It shall expose all information related to object types and give access
		 * to them, based on various identiiers (like the id).
		 */
		class ENGINE_SCRIPT_API Reflectable
		{
		public:

			SHARED(Reflectable);

			virtual ~Reflectable() {}



			/**
			 * @returns the number of types
			 */
			virtual int typeCount() const = 0;

			/**
			 * @tests if there is a type with the given id
			 */
			virtual bool hasType(int id) const = 0;

			/**
			 * @returns the type with the given id
			 * @throws when there is no type with the given id
			 */
			virtual const Type& type(int id) const = 0;

			/**
			 * @returns the function with the given id
			 * @throws when there is no function with the given id
			 */
			virtual Function function(int id) const = 0;

			/**
			 * @returns all types
			 */
			virtual std::vector<Type> types() const = 0;
		};
		///////////////////////////////////////////////////////////////////////////////////////////
	}
	///////////////////////////////////////////////////////////////////////////////////////////////
}
///////////////////////////////////////////////////////////////////////////////////////////////////
